package com.ydh.company.mapper;

import com.ydh.company.pojo.Condition;
import com.ydh.company.pojo.PurchaseOrderDetail;
import com.ydh.company.pojo.PurchaseOrderMain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PurchaseOrderMapper {
   /**
    * 增加采购订单主表数据
    * @param purchaseOrderMain
    * @return
    */
   int addPurchaseOrderMain(PurchaseOrderMain purchaseOrderMain);
   /**
    * 增加采购订单详情表数据
    * @param purchaseOrderDetail
    * @return
    */
   int addPurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail);

   /**
    * 查询采购订单列表
    * @return
    */
   List<PurchaseOrderMain> selectPurchaseOrderList();

   /**
    * 条件查询查询采购订单列表
    * @return
    */
   List<PurchaseOrderMain> selectPurchaseOrderListByCondition(Condition condition);
//   /**
//    * 入库页面查询采购订单数据
//    * @return
//    */
//   PurchaseOrderMain selectPurchase0rder(PurchaseOrderMain purchaseOrderMain);

   /**
    * 根据订单号查询采购订单详情
    * @param purchaseOrderNumber
    * @return
    */
   PurchaseOrderMain selectPurchaseOrderDetail(@Param("purchaseOrderNumber")String purchaseOrderNumber);

   /**
    * 查询采购订单详情表数据
    * @param purchaseOrderNumber
    * @return
    */
   PurchaseOrderDetail selectDetailOfPurchaseOrder(@Param("purchaseOrderNumber")String purchaseOrderNumber);

   /**
    * 采购订单入库
    * @param purchaseOrderMainId
    * @return
    */
   int updatePurchaseOrderWarehousingById(@Param("purchaseOrderMainId")String purchaseOrderMainId);
}
